'''
Created on May 29, 2012

@author: mupet
'''

import wx

class GeneralTab(wx.Panel):
    
    name = 'General'
    
    def createUI(self, sizer):
        startButton = wx.Button(self, label='Start')
        startButton.Bind(wx.EVT_BUTTON, self.listener.start)
        sizer.Add(startButton)
        sizer.Add(wx.StaticText(self))
        sizer.Add(wx.StaticText(self))
        statusLabel = wx.StaticText(self, label='Stopped')
        sizer.Add(statusLabel)
        self.listener.setStatusLabel(statusLabel)
        
        stopButton = wx.Button(self, label='Stop')
        stopButton.Bind(wx.EVT_BUTTON, self.listener.stop)
        sizer.Add(stopButton)
        sizer.Add(wx.StaticText(self))
        sizer.Add(wx.StaticText(self))
        sizer.Add(wx.StaticText(self))
        
        restartButton = wx.Button(self, label='Restart')
        restartButton.Bind(wx.EVT_BUTTON, self.listener.restart)
        sizer.Add(restartButton)


    def __init__(self, parent, generalEventListener):
        '''
        Constructor
        '''
        wx.Panel.__init__(self, parent)
        self.setListener(generalEventListener)
        sizer = wx.GridSizer(3,4,10,10)
        self.SetSizer(sizer)
        self.createUI(sizer)
        
    def setListener(self, generalEventListener):
        self.listener = generalEventListener.getGeneralTabListener()